﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using ControleRepresentante.Logic.Models;
using WebSite.ViewModels.EditViewModels.EditGridViewModels;

namespace WebSite.ViewModels
{
    public class UserViewModel : EditGridItem
    {
        private readonly User m_User;

        public UserViewModel()
            : this(new User())
        {
        }

        public UserViewModel(User user)
            : base(user)
        {
            m_User = user;
        }

        [Required(ErrorMessage = "*")]
        public string Username { get { return m_User.Username; } }
        [Required(ErrorMessage = "*")]
        [PasswordPropertyText]
        [DataType(DataType.Password)]
        public string Password { get { return m_User.Password; } }
        public bool Ativo { get { return m_User.Ativo; } }
        public string Email { get { return m_User.Email; } }
    }
}